﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace jaysJourney_v01.Utils.Blocks.Interactive.Types
{
    class InvisBlock : InteractiveBlock
    {
        /**
         * MEMBER VARIABLES
         * */

        private int counter = 0;
        private const int visibleTime = 1000;

        /**
         * METHODS
         * */

        // Constructor

        public InvisBlock(SpriteBatch parent, Vector2 position, Vector2 size, SpriteAnimator idleAnimation, SpriteAnimator triggerAnimation)
            : base(parent, position, size, idleAnimation, triggerAnimation)
        {

        }

        // MAIN UPDATE

        public override void update(GameTime gametime) {
            if (this.isTriggered)
            {
                if (triggerAnimation.hasFinished())
                {
                    this.isTriggered = false;
                    triggerAnimation.reset();
                }
                /*
                counter += gametime.ElapsedGameTime.Milliseconds;

                if (counter > visibleTime)
                {
                    counter = 0;
                    this.isTriggered = false;
                }
                 * */
            }
        }

        // MAIN DRAW

        public override void draw(GameTime gametime) { }

        // TRIGGER

        public override void trigger() { if (this.triggerAnimation.curFrame >= 12)this.triggerAnimation.curFrame = 12; }
    }
}